Faster Batched Range Minimum Queries
نویسندگان
چکیده
Range Minimum Query (RMQ) is an important building brick of many compressed data structures and string matching algorithms. Although this problem is essentially solved in theory, with sophisticated data structures allowing for constant time queries, there are scenarios in which the number of queries, q, is rather small and given beforehand, which encourages to use a simpler approach. A recent work by Alzamel et al. starts with contracting the input array to a much shorter one, with its size proportional to q. In this work, we build upon their solution, speeding up handling small batches of queries by a factor of 3.8–7.8 (the gap grows with q). The key idea that helped us achieve this advantage is adapting the wellknown Sparse Table technique to work on blocks, with speculative block minima comparisons. We also propose an even much faster (but possibly using more space) variant without the array contraction.
منابع مشابه
On (Dynamic) Range Minimum Queries in External Memory
We study the one-dimensional range minimum query (RMQ) problem in the external memory model. We provide the first spaceoptimal solution to the batched static version of the problem. On an instance with N elements and Q queries, our solution takes Θ(sort(N + Q)) = Θ ( N+Q B logM/B N+Q B ) I/O complexity and O(N + Q) space, where M is the size of the main memory and B is the block size. This is a...
متن کاملCheaper by the Dozen: Batched Algorithms
While computing power and memory size have been steadily increasing as predicted by Moore’s Law, they are still dwarfed by the size of massive data sets resultant from a number of applications. Many problems arising from astrophysics, computational biology, telecommunications, and the Internet often have an amount of accompanying data in the terabyte range. The analysis of this data by classica...
متن کاملI/O-Efficient Range Minima Queries
In this paper we study the offline (batched) range minima query (RMQ) problem in the external memory (EM) and cache-oblivious (CO) models. In the static RMQ problem, given an array A, a query rmqA(i, j) returns the smallest element in the range A[i, j]. IfB is the size of the block andm is the number of blocks that fit in the internal memory in the EM and CO models, we show that Q range minima ...
متن کاملFaster Batched Shortest Paths in Road Networks
We study the problem of computing batched shortest paths in road networks efficiently. Our focus is on computing paths from a single source to multiple targets (one-to-many queries). We perform a comprehensive experimental comparison of several approaches, including new ones. We conclude that a new extension of PHAST (a recent one-to-all algorithm), called RPHAST, has the best performance in mo...
متن کاملData Structures for Range Median Queries
In this paper we design data structures supporting range median queries, i.e. report the median element in a sub-range of an array. We consider static and dynamic data structures and batched queries. Our data structures support range selection queries, which are more general, and dominance queries (range rank). In the static case our data structure uses linear space and queries are supported in...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2017